[#ftl]
[@define "agile.form.TextBox" "agile.form._FormValueWidget,agile._Resizable"]
category:"TextBox Component"
,widgetName:"TextBox"
,resizeAxis:"x"	
,attributes:agile.delegate(agile.form._FormValueWidget.prototype.attributes,{	
	placeHolder:lang.mixin({},agile.TextMetadata,{label:"i18n_place_holder"})
	,trim:lang.mixin({},agile.BooleanMetadata,{	
		label:"i18n_trim"
   		,onValueChange:function(/*widget*/widget,/*String*/name,/*Object*/value){
   			widget.delegate.reset1(name,value);
//		   			widget.metadata("parameters."+name,value);
   			widget.metadata(this.metadataCategory+"."+name,value);
   			if(value == true){
   				widget.delegate.set("value",string.trim(widget.delegate.get("value")));
   				//widget.metadata("value",widget.delegate.get("value"));
   			}	   			
   		}
   })
   ,conversion: lang.mixin({},agile.ComboMetadata,{
	   label:"i18n_conversion"
	   ,options:[{"value":""},{"value":"uppercase"},{"value":"lowercase"},{"value":"propercase"}]		   		
   		,onValueChange:function(/*widget*/widget,/*String*/name,/*Object*/value){		
   			widget.metadata(name,value);
   			var delegate = widget.delegate;
			switch (value){
				case "uppercase": delegate.set("uppercase",true);delegate.set("lowercase",false);delegate.set("propercase",false);
				widget.metadata("parameters.uppercase",true);widget.metadata("parameters.lowercase",false);widget.metadata("parameters.propercase",false);
				break;
				case "lowercase": delegate.set("uppercase",false);delegate.set("lowercase",true);delegate.set("propercase",false);
				widget.metadata("parameters.uppercase",false);widget.metadata("parameters.lowercase",true);widget.metadata("parameters.propercase",false);
				break;
				case "propercase":delegate.set("uppercase",false);delegate.set("lowercase",false);delegate.set("propercase",true);
				widget.metadata("parameters.uppercase",false);widget.metadata("parameters.lowercase",false);widget.metadata("parameters.propercase",true);
				break;
				case "":delegate.set("uppercase",false);delegate.set("lowercase",false);delegate.set("propercase",false);
				widget.metadata("parameters.uppercase",false);widget.metadata("parameters.lowercase",false);widget.metadata("parameters.propercase",false);							
			}
			
			delegate.set("value",string.trim(delegate.get("value")));			
		}
   })
   ,uppercase:lang.mixin({},agile.BooleanMetadata,{
	   _hidden:true
   })
   ,lowercase:lang.mixin({},agile.BooleanMetadata,{
	   _hidden:true
   })
   ,propercase:lang.mixin({},agile.BooleanMetadata,{
	   _hidden:true
   })
   ,maxLength:lang.mixin({},agile.NumberMetadata,{
	   label:"i18n_max_length",_ignore:true,_hidden:true
   })		   
//   ,"event.onChange":lang.mixin({},agile.FunctionEditor,{
//	   label:"onChange"
//	   ,args:"value"		   
//   })
})
,_getDelegatePrototype:function(){
	agile.requireX("dijit/form/TextBox");
//	this.constructor.prototype.metadata("dojoDeclaredClass","dijit/form/TextBox");
	return dijit.form.TextBox.prototype;
}
 ,getResizableTargetContainer:function(){				
	return this.delegate.domNode;		 
}
,init:function(){
	if(this._initTextBox){
		return;
	}
	this._initTextBox = true;
	
	
	
}
[/@]
